<script type="text/javascript" src="/templates/ip_js.js"></script>
<script>
  $(document).ready(function(){
//        $(".display_cart").hide();
        $("div#riepilogo").hide()
    $("a.visualizza_ordine").click(function() {
        $("div#daoaddedit").hide();
       /* $("div#scrollingDiv").hide();*/
        $("div#riepilogo").show();
        var id_testata =  $(this).attr("id_testata");
        $('div#riepilogo_ordine').load('/visualizza_ordine',{"id_cliente":{{pageData['daoCliente'].id}}, "id_testata":id_testata });
    });


  });
</script>

{% include "giustopeso/azioni_prof.html" with context %}
<br>
<!-- <h1>STORICO ORDINI </h1><br />-->

{% if pageData['odc']!=[] %}
<table cellpadding="3" cellspacing="1" border="0" class="lista_clienti">
<tr>
    <td class="even-detail">Ordine</td>
    <td class="even-detail" width="150">Data</td>
    <td class="even-detail" width="150">Totale</td>
</tr>

{% for a in pageData['odc'] %}
{% set tota = a.totali %}
    <tr>
    <td align="left"><a href="#" class="visualizza_ordine" dao="Cliente" id_testata="{{a.id}}" >{{a.operazione}} - {{a.numero}}</a></td>
    <td align="left">{{ utils.dateToString(a.data_documento) }}</td>
    <td align="left">{{utils.mNLC(a._totaleScontato,2)}}</td>
    </tr>

{% if pageData["role"] == "Admin" %}
        <a class="delete_ordine" href="#" dao="{{pageData['_dao_']}}" id="{{a.id}}"  onClick='return confirm("Sei sicuro di voler cancellare?")' >
        <img src="/templates/img/trash.png" alt="elimina" title="elimina"/></a>

        <a class="edit_ordine" href="#" dao="{{pageData['_dao_']}}" id_cliente='{{pageData["daoCliente"].id}}' dao_td_id="{{a.id}}" actions="edit" onClick='return confirm("Sei sicuro di voler modificare?")'>
        <img src="/templates/img/modifica.png" alt="modifica" title="modifica"/></a>


        <a class="printt" onclick="window.open('/printt?dao={{pageData['_dao_']}}&amp;idr={{a.id}}','','width=550,height=120,left='+(screen.availWidth/2-200)+',top='+(screen.availHeight/2-200)+'');return false;" href="/printt?dao={{pageData['_dao_']}}&amp;idr={{a.id}}" >
        <img src="/templates/img/stampa_selezione24x24.png" alt="print" title="print"/></a>
{% endif %}

{% endfor %}
</table>
{% else %}
    <b>Nessun ordine effettuato</b>
{% endif %}
